﻿using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows;

namespace Edytor.Objects
{
    public class MapInfo : INotifyPropertyChanged
    {
        private string _mapName;
        public string MapName
        {
            get { return _mapName; }
            set { _mapName = value; PropertyNotify("MapName"); }
        }

        private Point _mapSize;
        public Point MapSize
        {
            get { return _mapSize; }
            set { _mapSize = value; PropertyNotify("MapSize"); }
        }

        private Point _tileSize;
        public Point TileSize
        {
            get { return _tileSize; }
            set { _tileSize = value; PropertyNotify("TileSize"); }
        }

        private ObservableCollection<Layer> _layerList;
        public ObservableCollection<Layer> LayerList
        {
            get { return _layerList; }
            set { _layerList = value; PropertyNotify("LayerList"); }
        }

        public MapInfo()
        {
        }

        public MapInfo(string mapName, Point mapSize, Point tileSize)
        {
            LayerList = new ObservableCollection<Layer>();
           // LayerList.Add(new Layer("Default", 0));
            MapName = mapName;
            MapSize = mapSize;
            TileSize = tileSize;
        }

        public event PropertyChangedEventHandler PropertyChanged;
        public void PropertyNotify(string s)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(s));
        }
    }
}
